package com.wnu.springboot.db.bean;

import com.sun.org.apache.bcel.internal.util.ClassPath;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

/**
 * @Author 20424
 * @Date 2020/8/14 15:49
 * @Version 1.0
 */
@Repository
@ConfigurationProperties(prefix = "jdbc")
@PropertySource(value = "classpath:database.peoperty")
/**
 * 读取默认的配置文件（application.properties）使用@ConfigurationProperties即可
 * 非默认配置文件：@ConfigurationProperties 和@PropertySource
 */
public class DataSource {
    public String username;
    public String password;
    public String driver;

    public DataSource() {
    }

    public DataSource(String username, String password, String driver) {
        this.username = username;
        this.password = password;
        this.driver = driver;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }
}
